
#pragma once
#ifndef _WORLD_H_
#define _WORLD_H_
#include <Ogre.h>
#include <OIS.h>
#include "PapaBallMsg.h"
class AbstractController;
typedef std::map<Ogre::String,AbstractController*> ControllerContainerType;
class AbstractController;
class World
{
	enum StateType
	{
		Ready,
		PhysicUpdate,
		AddTimeStart,
		AddingTime,
		AddTimeEnd
	};
private://fields
	StateType mState;
	bool bDestroy;
	ControllerContainerType mControllerContainer;
	OIS::InputManager* mInputMgr;
public://cons&destroy
	World():mState(StateType::Ready),bDestroy(false){}
	~World();
public://method
	void AddTime(Ogre::Real deltaTime);
	void SendWorldMsg(PapaBallMsg msg);
	void SendMsg(Ogre::String Target,PapaBallMsg msg);
	void Destroy();
	void RegisterController(Ogre::String name,AbstractController* controller);
	void DestroyController(Ogre::String name);
	AbstractController* CreateController(Ogre::String ContollerType,Ogre::String name);
	AbstractController* GetController(Ogre::String name);
};
#endif